RE: Literary titles & formatting

by Kynn Bartlett <kynn-hwg(at)idyllmtn.com>

 Date:  Thu, 24 Jan 2002 15:05:04 -0800
 To:  <paciello(at)webable.com>,
"John Foliot - Another 4:00 AM Web Thing" <foliot(at)fouram.com>,
"Liz Roberts" <liz(at)netlogix.net>
 Cc:  "Aware-Techniques" <aware-techniques(at)hwg.org>
 References:  webable
  todo: View Thread, Original
At 5:36 PM -0500 1/24/02, Mike Paciello wrote:
>I have a question maybe someone can answer -- deals with CSS.

Oh, goodie!  I am into CSS these days.

>Does anyone know what the proper way to add alternative text to an image
>that is used in a list-style-image property is?
>  I've done the following and the help text seems to work (at least on
>  MSIE)... but thought one of you might already know what would be the
>  correct method?
>
>  <STYLE TYPE="text/css">
>    LI.word {list-style-image: url(images/ms_word_doc.gif)}
>    LI.pdf  {list-style-image: url(images/adobe_acrobat_pdf.gif)}
>  </STYLE>
>
>  <LI class="word" title="Word Document"><a class="LinkMBRT"
>  href="documents/MBRT/MBRT_Description_of_Services.doc">Description of
>  Services</a></LI>

You don't add alt text to images used as list-style images; they're
considered pure presentation. Non-CSS browsers will just render them
as normal bullet points.

In the case below, I would not use list-style-image because there is
important content conveyed; the title on the LI somewhat makes up for
that but I believe it would be more proper to simply use an <img>
tag instead of changing the bullet with CSS. It strikes me as
inappropriate to use title as the only method of conveying content,
because title is not displayed consistently by browsers.

So, instead:

<li><img src="images/ms_word_doc.gif" alt="Word Document"><a 
class="LinkMBRT" ...> etc </a></li>

CSS is useful but should never be used to encode content which may
be lost if the CSS is turned off; only use it for presentation
effects. In this case, the file type of the download is so important
to know that you don't want to risk losing it in a CSS rule.

Also -- the size of the file should be listed, in my opinion.

>Thanks, Mike
>PS: I've been talking to Kynn this afternoon -- so he is alive :-)

Well, why didn't you just ask me this question? Oh wait, you did! :)

--Kynn

-- 
Kynn Bartlett <kynn(at)idyllmtn.com>                 http://kynn.com
Chief Technologist, Idyll Mountain            http://idyllmtn.com
Web Accessibility Expert-for-hire          http://kynn.com/resume
January Web Accessibility eCourse           http://kynn.com/+d201
Forthcoming: Teach Yourself CSS in 24 Hours

HWG: hwg-basics mailing list archives, maintained by Webmasters @ IWA